//
//  UIButton+Extension.swift
//  Weibo
//
//  Created by 伍银荣 on 2021/12/16.
//  Copyright © 2021 com.WYR. All rights reserved.
//

import UIKit

extension UIButton {
    //遍历构造函数
    convenience init(title: String, titleColor: UIColor, btnBackgroundColor: UIColor) {
        //需要先调用本类的指定构造函数
        self.init()
        setTitle(title, for: .normal)
        setTitleColor(titleColor, for: .normal)
        backgroundColor = btnBackgroundColor
        //遍历构造函数执行完毕,这个控件就已经被创建了
    }
}
